#ifndef _MSG_H_
#define _MSG_H_

#include "main.h"


typedef enum{
	MSG_TYPE_SYS = 0,
	MSG_TYPE_UART,
	MSG_TYPE_NULL = 0xff,
}MSG_TYPE_E;

typedef enum{
	MSG_SY880X_IRQ = 0,
    MSG_SY880X_ABNORMAL,
    MSG_SY880X_EAR_ABNORMAL,
    
	MSG_HALL_IRQ,
	MSG_OPEN_BOX,
	MSG_CLOSE_BOX,
	MSG_EAR_IN_BOX,
	MSG_EAR_OUT_BOX,
	
	MSG_USB_IN,
	MSG_USB_OUT,
	MSG_BAT_CHARGE,
	MSG_BAT_CHARGE_STOP,
	MSG_BAT_CHARGE_FULL,
	
	MSG_KEY_CLICK,
	MSG_KEY_DOUBLE,
	MSG_KEY_TRIPLE,
	MSG_KEY_LONG_1S,
	MSG_KEY_LONG_3S,
	MSG_KEY_LONG_6S,
	MSG_KEY_LONG_10S,

    MSG_NTC_IDLE,
    MSG_NTC_LOW_TEMP,
    MSG_NTC_HIGH_TEMP,
}SYS_MSG_E;

typedef enum{
	MSG_EAR_R_RX = 0,
	MSG_EAR_L_RX,
}UART_MSG_E;

void app_msg_init(void);

void app_msg_send(uint8_t msg);
void app_msg_send_with_param(uint8_t msg, uint8_t *param, uint8_t param_len);
void app_msg_send_uart_data(uint8_t msg, uint8_t *param, uint8_t param_len);

uint8_t app_msg_get(uint8_t *msg_id, uint8_t *param, uint8_t *param_len);



#endif

